import React from 'react'
import PropTypes from 'prop-types'
import { View, Text, StyleSheet } from 'react-native'
import { ScaleS, ScaleT } from 'src/utils/ScreenUtil'
import CustomImage from 'src/components/image/CustomImage'
import CustomButton from 'src/components/button/CustomButton'

export default class SchoolManage extends React.PureComponent {
  static propTypes = {
    schoolClick: PropTypes.func,
    dataApplyLive: PropTypes.number,
    dataCollectLive: PropTypes.number,
    dataPostLive: PropTypes.number
  }

  static defaultProps = {
    jobData: {}
  }

  render () {
    const {
      schoolClick,
      dataApplyLive,
      dataCollectLive,
      dataPostLive
    } = this.props
    return (
      <View style={styles.container}>
        <View style={styles.myJobContentView}>
          <View style={styles.contentItem}>
            <CustomImage
              style={styles.myJobContentItemImg}
              source={require('@/imgC/userinfo/zbyy.png')}
            />
            <CustomButton
              style={styles.myJobContentItemVIew}
              params={{ index: 0, liveKey: 'subscribe' }}
              onPress={schoolClick}
            >
              <Text style={styles.myJobContentItemLabel}>直播预约</Text>
              <View style={styles.myJobContentItemLabelBottom}>
                <Text style={styles.label}>{`已预约：${dataApplyLive || 0}`}</Text>
              </View>
            </CustomButton>
          </View>
          <View style={styles.contentItem}>
            <CustomImage
              style={styles.myJobContentItemImg}
              source={require('@/imgC/userinfo/zbsc.png')}
            />
            <CustomButton
              style={styles.myJobContentItemVIew}
              params={{ index: 1, liveKey: 'collection' }}
              onPress={schoolClick}
            >
              <Text style={styles.myJobContentItemLabel}>直播收藏</Text>
              <View style={styles.myJobContentItemLabelBottom}>
                <Text style={styles.label}>{`已收藏：${dataCollectLive || 0}`}</Text>
              </View>
            </CustomButton>
          </View>
          <View style={styles.contentItem}>
            <CustomImage
              style={styles.myJobContentItemImg}
              source={require('@/imgC/userinfo/ytjl.png')}
            />
            <CustomButton
              style={styles.myJobContentItemVIew}
              params={{ index: 2, liveKey: 'resume' }}
              onPress={schoolClick}
            >
              <Text style={styles.myJobContentItemLabel}>已投简历</Text>
              <View style={styles.myJobContentItemLabelBottom}>
                <Text style={styles.label}>{`已投递：${dataPostLive || 0}`}</Text>
              </View>
            </CustomButton>
          </View>
        </View>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    marginTop: ScaleS(25),
    marginHorizontal: ScaleS(20)
  },
  manageTitle: {
    color: '#000000',
    fontSize: ScaleT(25),
    lineHeight: ScaleS(36),
    fontWeight: '500'
  },
  myJobContentView: {
    marginTop: ScaleS(2)
  },
  contentItem: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    marginBottom: ScaleS(20)
  },
  myJobContentItemImg: {
    width: ScaleS(23),
    height: ScaleS(21),
    marginRight: ScaleS(22),
    marginLeft: ScaleS(3),
    marginTop: ScaleS(13)
  },
  myJobContentItemVIew: {
    flex: 1,
    flexDirection: 'column',
    // height: ScaleS(80),
    borderRadius: ScaleS(8),
    backgroundColor: '#F9F9F9',
    paddingVertical: ScaleS(15),
    paddingHorizontal: ScaleS(15)
  },
  myJobContentItemLabel: {
    color: '#3C3C3C',
    fontSize: ScaleT(15),
    fontWeight: '500'
  },
  myJobContentItemRightLabel: {
    flex: 1,
    flexDirection: 'row'
  },
  label: {
    color: '#BEBEBE',
    fontSize: ScaleT(12),
    fontWeight: '400',
    marginTop: ScaleS(23),
    marginRight: ScaleS(20)
  },
  myJobContentItemRightImg: {
    width: ScaleS(7),
    height: ScaleS(5),
    transform: [{ rotate: '-90deg' }]
  }
})
